﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace iTeamyou.LTS.Core.Models
{
	/// <summary>
	/// 商品证照
	/// </summary>
	public class ProductLicense
	{
        /// <summary>
        /// 证照编码
        /// </summary>
        [DisplayName("证照编码")]
        [Description("证照编码")]
        [Required(ErrorMessage = "证照编码不能为空")]
        public string LId { get; set; }

        /// <summary>
        /// 证照名称
        /// </summary>
        [DisplayName("证照名称")]
        [Description("证照名称")]
        [Required(ErrorMessage = "证照名称不能为空")]
        public string? Name { get; set; }

        /// <summary>
        /// 证照类型
        /// </summary>
        [DisplayName("证照类型")]
        [Description("证照类型")]
        [Required(ErrorMessage = "证照类型不能为空")]
        public string Type { get; set; }

        /// <summary>
        /// 关联供应商名称
        /// </summary>
        [DisplayName("关联供应商名称")]
        [Description("关联供应商名称")]
        //[Required(ErrorMessage = "关联供应商名称不能为空")]
        public string? SupplierName { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [DisplayName("商品名称")]
        [Description("商品名称")]
        [Required(ErrorMessage = "商品名称不能为空")]
        public string ProductName { get; set; }

        /// <summary>
        /// 商品编码
        /// </summary>
        [DisplayName("商品编码")]
        [Description("商品编码")]
        [Required(ErrorMessage = "商品编码不能为空")]
        public string ProductId { get; set; }

        /// <summary>
        /// 剩余有效时间
        /// </summary>
        [DisplayName("剩余有效时间")]
        [Description("剩余有效时间")]
        [NotMapped]
        public int? RemainingDays { get; set; }

        /// <summary>
        /// 有效开始日期
        /// </summary>
        [DisplayName("有效开始日期")]
        [Description("有效开始日期")]
        [Required(ErrorMessage = "有效开始日期不能为空")]
        public DateTime? ValidFromDate { get; set; }

        /// <summary>
        /// 有效结束日期
        /// </summary>
        [DisplayName("有效结束日期")]
        [Description("有效结束日期")]
        [Required(ErrorMessage = "有效结束日期不能为空")]
        public DateTime? ValidToDate { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        [Description("创建时间")]
        public DateTime? CreatedOn { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        [DisplayName("创建者")]
        [Description("创建者")]
        public string CreatedBy { get; set; }

        /// <summary>
        /// 最近更新时间
        /// </summary>
        [DisplayName("最近更新时间")]
        [Description("最近更新时间")]
        public DateTime? LastModifiedOn { get; set; }

        /// <summary>
        /// 最近更新者
        /// </summary>
        [DisplayName("最近更新者")]
        [Description("最近更新者")]
        public string LastModifiedBy { get; set; }

        /// <summary>
        /// 证照附件URL
        /// </summary>
        [DisplayName("证照附件")]
        [Description("证照附件")]
        [BizDataType("ListURL")]
        [NotMapped]
        public List<string>? AttachmentURL { get; set; }

        /// <summary>
        /// 证照附件
        /// </summary>
        [DisplayName("证照附件")]
        [Required]
        public List<ProductLicenseAttachment> Attachments { get; set; }

        [Required]
        public Product Product { get; set; }

        /// <summary>
        /// 系统唯一标识
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 是否已发布
        /// </summary>
        public bool IsPublish { get; set; }

        /// <summary>
        /// 关联流程标识
        /// </summary>
        public string RefFlowId { get; set; }

        /// <summary>
        /// 证照状态
        /// </summary>
        public LicenseOp OperationType { get; set; } 
    }


}

